home *** CD-ROM | disk | FTP | other *** search
/ Enter 2002 August / EnterCD 8_2002.iso / Internet / Adobe GoLive 6.0 / data1.cab / PF_AppDir_Mod_JScript_GlobalScripts / StyleTrans.scpt < prev    next >
Encoding:
Text File  |  2002-03-28  |  1.5 KB  |  35 lines

  1. function CSGetLayerClip (el) {
  2.     CSIDOM();
  3.     if (el.isIE) return (new CSRect(0,0,el.offsetWidth,el.offsetHeight));
  4.     else if (CSBVers>=5) return (new CSRect(0,0,parseInt(el.style.width),parseInt(el.style.height)));
  5.     else return (new CSRect(el.clip.left,el.clip.top,el.clip.width,el.clip.height));
  6. }
  7. function CSSetLayerClip (el,clipRect) {
  8.     var l,t,r,b;
  9.     l=clipRect.left; t=clipRect.top; r=l+clipRect.width; b=t+clipRect.height;
  10.     if(el.isIE) { el.style.clip = "rect("+ t + " " + r + " " + b + " " + l + ")"; }
  11.     else if (CSBVers>=5) el.style.clip = "rect("+ t + "px, " + r + "px, " + b + "px, " + l + "px)";
  12.     else { el.clip.left=l; el.clip.top=t; el.clip.width=clipRect.width; el.clip.height=clipRect.height; }
  13.     CSSetStyleVis(el.layer);
  14. }
  15. function CSRect (left,top,width,height) {
  16. this.left=left; this.top=top; this.width=width; this.height=height;
  17. }
  18. function CSCreateTransElement (layer, steps) {
  19.     var el;
  20.     if (IsIE()) el=document.all.tags("div")[layer];
  21.     else if (CSBVers>=5) el=document.getElementById(layer);
  22.     else el=CSNSStyl(layer);
  23.     if (el==null) return null;
  24.     if (el.locked && (el.locked == true)) return null;
  25.     el.isIE=IsIE();
  26.     el.clipRect=CSGetLayerClip(el);
  27.     if (el.clipRect==null) return null;
  28.     el.maxValue=steps;
  29.     if (el.maxValue<=0) el.maxValue=30;
  30.     el.modus=""; el.layer=layer;
  31.     el.width=el.clipRect.width; el.height=el.clipRect.height;
  32.     el.locked = true;
  33.     return el;
  34. }
  35. function CSDisposeTransElement (el) { el.locked = false; }